package com.permission.config;

import org.apache.ibatis.io.Resources;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * TODO
 *
 * @author my
 * @date 2020/7/11 11:55
 */
public class CodeConfig {
    public static final int LOGIN_FILED=201;
    public static final int SUCCESS=200;
    public static final int SYSTEM_ERROR=500;
    public static final int ERROR_CODE=401;
    public static final int RESOURCE_NOT_FOUND=404;
    public static final int ACCESS_DENIED=403;
    public static final int ERROR=400;

    public static Properties msg;

    private static final String MSG_PATH="msg.properties";
    static {
        Properties properties=new Properties();
        InputStream inputStream=null;
        System.out.println("CodeConfig ---> static initializer() :");
        try {
            inputStream=Resources.getResourceAsStream(MSG_PATH);
            properties.load(inputStream);
            msg=properties;
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            if (inputStream!=null){
                try {
                    inputStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
